﻿namespace KinonekoSoftware.Studio
{
    partial class Platform
    {
        public const string ID_AdvanceEditor         = "Editor_{0}";
        public const string FileName_JuXiaoYou5_Repo = "JuXiaoYou5-repo.cfg";


        public static string GetAdvancedEditorID(string id) => $"Editor_{id}";
        private static string GetNotionID(string id) => $"Notion_{id}";
        private static string GetStoryID(string id) => $"Story_{id}";


        public static void ThisNotion(this ViewModelBase vm, INotion notion)
        {

            var context = new PageContext { Id = GetNotionID(notion.Id) };
            

            context.Set<INotion>(ContextBase.Key_Value, notion);

            //
            // TODO:
            vm.GoTo<NotionEditorViewModel>(context);
        }

        public static void ThisNotion(this ViewModelBase vm, NotionDraft notion)
        {

            var context = new PageContext { Id = GetNotionID(notion.Id) };

            //
            //
            context.Set<NotionDraft>(ContextBase.Key_Value, notion);

            //
            // TODO:
            vm.GoTo<NotionEditorViewModel>(context);
        }

        public static void ThisStory(this ViewModelBase vm, IStory story)
        {

            var context = new PageContext { Id = GetStoryID(story.Id) };

            //
            //
            context.Set<IStory>(ContextBase.Key_Value, story);

            //
            // TODO:
            // vm.GoTo<StoryboardEditorViewModel>(context);
        }
    }
}